{extend name="$_admin_public_base_"/}
{block name="style"}
  <style type="text/css">
    .theme-item{padding:10px;}
    .block-content{background-color: #f5f5f5!important;margin:0 10px;border-radius: 3px;color: #666;border:1px solid #f0f0f0;}
    .theme-cover img{height: 230px;}
    .theme-logo {width: 100%;}
    .block-content h3{font-size: 16px;margin: 0 auto;padding: 20px 0;margin-bottom: 15px;color: #656565;border-bottom: 1px solid #d5d5d5;position: relative;white-space: nowrap;text-align: center;}
    .block-content h3::before {
        content: '';
        bottom: -10%;
        background: #ccc;
        left: 43%;
        width: 10px;
        height: 10px;
        position: absolute;
        border-radius: 50%;
    }

    .block-content h3::after {
        content: '';
        bottom: -10%;
        background: #ccc;
        right: 43%;
        width: 10px;
        height: 10px;
        position: absolute;
        border-radius: 50%;
    }

    .item-metas,.item-description{padding:0 10px;line-height: 26px;color: #888;}
    .item-description{font-size: 13px;height: 40px;}
  </style>
{/block}

{block name="main"}
<section class="content pt-5">
<div class="box box-solid eacoo-box">
    {:logic('admin/AppStore')->getAppStoreTabs('theme')}
    <div class="box box-solid">
        <div class="box-header with-border">
          <h3 class="box-title">温馨提示</h3>
          <div class="box-tools">
            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
            </button>
          </div>
          <p class="f13 color-6 pt-5">
            可在线安装、卸载、禁用、启用主题，同时支持本地安装。EacooPHP已上线应用市场，你可以发布你的免费或付费主题：<a href="{:config('eacoo_api_url')}/appstore/themes" target="_blank" >{:config('eacoo_api_url')}/appstore/themes</a>
         </p>
        </div>
        <div class="box-body no-padding">

        </div>
    </div>

    <div class="box-body">
        <div class="eacoo-tabs builder-form-tabs">
            <ul class="nav nav-tabs">
                {volist name="tab_list" id="tab"}
                    <li class="{php}if($from_type == $key) echo 'active';{/php}"><a class="reset-appstore-conent" href="{$tab.href}" {$tab.extra_attr|default=''}>{$tab.title}</a></li>
                {/volist}
            </ul>
            <div class="form-group"></div>
        </div>
        <div class="builder-toolbar mt-10 oh">
           <div class="col-xs-12 col-sm-12 button-list clearfix">
              <button class="btn btn-info btn-sm " id="app-localupload"><i class="fa fa-cloud-upload"></i> 本地安装</button>
              <a class="btn btn-success btn-sm ajax-get" href="{:url('admin/Themes/refresh')}"><i class="fa fa-refresh"></i> 刷新缓存</a>
              <a title="重置主题" class="btn btn-primary btn-sm ajax-get confirm" confirm-info="重置主题后，将会取消所有正在使用的主题。" href="{:url('admin/Themes/cancel')}"> 重置主题</a>
              <button class="btn btn-default btn-sm" id="eacoo-userinfo" ><i class="fa fa-user"></i> 会员信息</button>
          </div>
        </div>

        <div class="builder formbuilder-box panel-body">

            <div class="row" id="appstore-content">    
              
           </div><!--row-->
         </div>
     </div>
</div>
</section>
<script id="appstore_tpl" type="text/html">
  <% for (var i = 0; i < data.length; i ++) { %>
   <% var row = data[i]; %>
   <div class="col-md-4 theme-item"> 
    <div class="block-content">     
        <div class="theme-cover view-app-detail" data-name="<%= row.name %>" data-type="theme" style="cursor: pointer;">{{@row.logo}}</div>
        <h3><%= row.title %></h3>
        <div class="item-metas"><span class="meta-author"><i class="fa fa-user"></i> <a href="{:config('eacoo_api_url')}/appstore_theme/<%= row.name %>" target="_blank"><%= row.author %></a></span>
          <% if (row.status && row.status!='undefined') { %><span class="meta-status text-success pull-right">{{@row.status}}</span><% } %></div>
        <div class="item-description"><%= row.description %></div>
        <div class="ml-10 mt-10 mb-10">
            {{@row.right_button}}
        </div>
      </div>
  </div>

  <% } %>
  <% if(data.length==0){ %>
    <div class="tc no-found">
      <p>暂无主题，请前往<a href="{:url('index',['from_type'=>'oneline'])}">主题市场</a>下载</p>
    </div>
  <% } %>
</script>
{/block}

{block name="script"}
<script type="text/javascript" src="__LIBS__/artTemplate/template.js"></script>
<script type="text/javascript" src="__ADMIN_JS__/eacoo.extension.js?v={:EACOOPHP_V}" ></script>
<link href="__LIBS__/webuploader/css/webuploader.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="__LIBS__/webuploader/js/webuploader.min.js"></script>
<script>
    var apptype = 'theme';
    var from_type = '{:$from_type}';
</script>
{/block}